package com.itheima.sky.controller.front;

import com.itheima.sky.entity.Result;
import com.itheima.sky.pojo.Category;
import com.itheima.sky.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description CategoryController
 * @Author jiangning
 * @Date 2024-06-28
 */
@RestController
@Slf4j
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;
    @GetMapping("/list")
    public Result getAllCates(){
        List<Category> cates = categoryService.getAllCates();
        return Result.success(cates);
    }
}
